{extend name="layout/layout" /}

{block name="content"}
<link href="__STATIC__/plugins/ueditor/ueditor.css" rel="stylesheet" type="text/css" />
<style>
    #edui1_imagescale{display:none !important;}  /*点击上传的图片后出现的拉伸边框*/
    .edui-editor-bottomContainer{display: none;}
</style>
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 添加</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form class="form-horizontal" method="post" enctype="multipart/form-data">
                    <div class="form-body">
                        <div class="row" style="margin-bottom: 10px;">
                            <div class="col-md-9">
                                <div class="form-inline">
                                    <label class="control-label col-md-3">
                                        阅读范围
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        {include file="common:selectarea" /}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        标题
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" placeholder="标题名称，最多40字" id="title" maxlength="40" data-required="1" name="title" value="" required>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row" {if condition="($type == 'notice') OR ($type == 'toutiao') OR ($type == 'povertydynamic')"} style="display: none" {/if}>
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        分类<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <select class="form-control" name="typeId">
                                            {if condition="($type == 'notice') OR ($type == 'toutiao') OR ($type == 'povertydynamic')"}
                                            <option value="{$typeList[0]['id']}">{$typeList[0]['name']}</option>
                                            {else /}
                                            <option value="0">请选择</option>
                                            {volist name="typeList" id="vo"}
                                            <option value="{$vo.id}">{$vo.name}</option>
                                            {/volist}{/if}
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row" {if condition="($type == 'notice') OR ($type == 'toutiao') "} style="display: none" {/if}>
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        图片<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <div id="upload-image">
                                            <span id="upload-btn" data-multi="false">
                                                <input type="hidden" class="form-control" id="iconUrl" data-required="1" name="iconUrl" value="">
                                                <img src="__STATIC__/admin/img/default.png" alt="图片上传" style="width: 100px;height: 100px;" />
                                            </span>
                                        </div>
                                        {if condition="$type == 'work' "}
                                        <span class="help-block"> (建议尺寸：65*65) </span>
                                        {else /}
                                        <span class="help-block"> (建议尺寸：135*90) </span>
                                        {/if}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        排序
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" id="orderNo" maxlength="4" name="orderNo" value="100" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        详情<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <script id="container" name="detail" type="text/plain"></script>
                                        <div id="pro_txt" class="hidden"></div>

                                        <div id="btn-uploader1">
                                            <a id="pickfiles1" href="javascript:void 0;"></a>
                                            <a id="pickfilesforarticleRadio" href="javascript:;"></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <input type="hidden" name="type" value="{$type}">

                        <hr />
                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" id="form-submit" class="btn blue save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">
{/block}

{block name="pagescript"}
<script>
    var posturl = "{:url('admin/'.strtolower($model).'/addpost')}";
</script>
<script type="text/javascript" src="__STATIC__/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/plugins/ueditor/ueditor.all.js"></script>
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/ueditor.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/uploadfile.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/article.js" type="text/javascript"></script>
{/block}